/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package csm.uttils.generics;

import java.io.Serializable;

/**
 *
 * @author Carlos S. Moreno
 */
public class Node<E extends Comparable> implements Serializable {

    private E info;
    private Node<E> next;

    /**
     * Constructor
     */
    public Node(){}
/**
 * Constructor with parameters
 * @param info Object to be saved
 * @param next Next element on the list.
 */
    public Node(E info, Node<E> next)
    {
        this.info = info;
        this.next = next;
    }

    public Node<E> getNext()
    {
        return next;
    }

    public void setNext(Node<E> n)
    {
        next = n;
    }

    public E getInfo()
    {
        return info;
    }

    public void setInfo(E inf)
    {
        info = inf;
    }

    public String toString()
    {
        return info.toString();
    }

}
